<!--
  @author nowind
  @since 17/07/23 14:34
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<title>修改前台产品服务分类</title>
</head>
<body>
<div class="layui-fluid">
    <blockquote class="layui-crumb">
        前台产品>产品分类>
        <a lay-href="/serv/showCateg/list.action">服务分类</a>>
        <a th:href="'/serv/showCateg/detail.action?categId='+${categ.categId}">[[${servCategory.name == null ? '' : servCategory.name }]]</a>
    </blockquote>

    <div class="layui-card">

        <div th:replace="servcategroy/show/_tab::tab"></div>

        <div class="layui-card-body">

            <form method="post" action="" class="layui-form" lay-filter="zmn-form">

                <input type="hidden" name="categId" th:value="${categ.categId}"/>

                <div class="layui-form-item" th:if="${categ.categId > 0}">
                    <label class="layui-form-label">分类ID：</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid">
                            <span th:text="${categ.categId}">ID</span>
                            <span style="font-family:'ArialMT', 'Arial';color:#33AB9F;" th:text="${categ.showStatus == 2 ? '正常' : '停用'}">showStatus</span>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">服务分类：</label>
                    <div class="layui-input-inline" style="width: 390px">
                        <input type="text" style="width:200px;" name="showName" th:value="${categ.showName}" placeholder="请输入前台分类名称"
                               lay-verify="required|showName" autocomplete="off" class="layui-input" maxlength="20" id="showName"/>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">首页icon：</label>
                    <div class="layui-upload-drag" id="showHomePageIcon">
                        <input type="hidden" lay-verify="required" id="showHomePageIconValue" name="showHomePageIcon">
                        <i class="layui-icon"></i>
                        <p>点击上传</p>
                    </div>
                    <div class="layui-inline">
                        <i onclick="deleteImg('showHomePageIcon')"  class="layui-icon layui-icon-delete btn-del funcClass"></i>
                        <br>
                        <span style="color: #9F9F9F;">建议上传：xx * xx尺寸，png格式，小于1M
                        用于：前端店铺首页icon展示</span>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">分类页图片：</label>
                    <div class="layui-upload-drag" id="showCategoryPagePicture">
                        <input type="hidden" lay-verify="required" id="showCategoryPagePictureValue" name="showCategoryPagePicture">
                        <i class="layui-icon"></i>
                        <p>点击上传</p>
                    </div>
                    <div class="layui-inline">
                        <i onclick="deleteImg('showCategoryPagePicture')"  class="layui-icon layui-icon-delete btn-del funcClass"></i>
                        <br>
                        <span style="color: #9F9F9F;">建议上传：xx * xx尺寸，png格式，小于2M
                        用于：前端店铺服务分类页展示</span>
                    </div>

                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">计价器名称：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="tariffName" autocomplete="off" maxlength="20" class="layui-input" th:value="${categ.tariffName}"
                               lay-verify="required">
                    </div>
                </div>
                <div class="layui-form-item" style="display: none">
                    <label class="layui-form-label layui-form-required">计价器状态：</label>
                    <div class="layui-input-block">
                        <input name="tariffStatus" value="2">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">排序ID：</label>
                    <div class="layui-input-inline">
                        <input type="number" name="showSort" autocomplete="off" class="layui-input" th:value="${categ.showSort}"
                               lay-verify="sort">
                    </div>
                    <div class="layui-input-inline" style="width:160px;">
                        <label class="layui-form-mid" style="color: #9F9F9F;">数字越小，在越前面</label>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">分类简称：</label>
                    <div class="layui-input-inline">
                        <input name="showSimpleSpell" autocomplete="off" class="layui-input" th:value="${categ.showSimpleSpell}"
                               lay-verify="simpleSpell" maxlength="10" id="showSimpleSpell">
                    </div>
                </div>

                <style>
                    .layui-form-label {
                        width: 130px;
                    }
                </style>

                <div class="layui-form-item submit">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit"
                                th:if="${#authPermit.checkPermit('/serv/showCateg/addEdit.action')}">保存
                        </button>
                        <button type="reset" class="layui-btn layui-btn-primary"
                                onclick="layui.admin.events.closeThisTabs();">取消
                        </button>
                    </div>
                </div>

            </form>
        </div>
    </div>
</div>
</body>
</html>

<script type="text/javascript" th:inline="javascript">
    var json = {
        servCategory: [[${categ}]]
    };

    layui.config({
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        art_serv_categ_show_edit: "servcategory/show/zmn.art.serv.categ.edit",
    }).use(['index', 'art_serv_categ_show_edit']);

</script>